import axios from "../index.js";
// 预警任务列表分页查询
export const listPage = (data) => {
  return axios.request({
    url: "/warning/warningMainTask/app/listPage",
    // url: "/warning/warningMainTask/listPage",
    method: "post",
    data: data
  });
};

// 预警任务反馈列表分页查询
export const feedbackListPage = (data) => {
  return axios.request({
    url: "/docking/warningFeedback/listPage",
    method: "post",
    data: data
  });
};


export const listPageTask = (data) => {
  return axios.request({
    url: "/warning/warningMainTask/listPageTask",
    method: "get",
    data: data
  });
};

export const listPage2 = (data) => {
  return axios.request({
    // url: "/warning1/warningMainTask/listPage",
    url: "/warning/warningMainTask/listPage2",
    method: "post",
    data: data
  });
};

// 预警任务-任务分配保存/修改
export const saveTask = (data) => {
  return axios.request({
    // url: "/warning1/warningDistributionTask/saveOrUpdate",
    url: "/warning/warningDistributionTask/saveOrUpdate",
    method: "post",
    data: data
  });
};

// 预警任务-任务分配审核
export const approvalTask = (data) => {
  return axios.request({
    // url: "/warning1/warningDistributionTask/approval",
    url: "/warning/warningDistributionTask/approval",
    method: "post",
    data: data
  });
};

// 预警任务-任务分配提交
export const submitTask = (data) => {
  return axios.request({
    // url: "/warning1/warningDistributionTask/submit",
    url: "/warning/warningDistributionTask/submit",
    method: "post",
    data: data
  });
};

// 预警任务列表删除
export const deleteTask = (data) => {
  return axios.request({
    // url: "/warning1/warningMainTask/deleteById",
    url: "/warning/warningDistributionTask/deleteById",
    method: "post",
    data: data
  });
};

// 预警任务-任务分配详情
export const getById = (data) => {
  return axios.request({
    // url: "/warning1/warningMainTask/getById",
    url: "/warning/warningMainTask/getById",
    method: "get",
    data: data
  });
};


// 预警任务-任务派遣详情
export const getMission = (data) => {
  return axios.request({
    url: "/warning/warningSubMainTask/getById",
    method: "get",
    data: data
  });
};

// 预警任务-任务派遣保存
export const saveMission = (data) => {
  return axios.request({
    url: "/warning/warningSubMainTask/saveOrUpdate",
    method: "post",
    data: data
  });
};

// 预警任务-任务派遣提交
export const submitMission = (data) => {
  return axios.request({
    url: "/warning/warningSubMainTask/submit",
    method: "post",
    data: data
  });
};

// 预警任务-审批详情
export const getSpDetail = (data) => {
  return axios.request({
    url: "/warning/warningSubMainTask/getDetail",
    method: "get",
    data: data
  });
};


// 预警任务-任务派遣下派
export const taskDispatch = (data, saveType) => {
  return axios.request({
    url: `/warning/warningSubMainTask/taskDispatch?saveType=${saveType}`,
    method: "post",
    data: data
  });
};


// 预警任务-子任务审批
export const childApproval = (data) => {
  return axios.request({
    url: "/warning/warningSubMainTask/approval",
    method: "post",
    data: data
  });
};

// 已发布关联预警通知单分页查询
export const getIssueNoticeList = (data) => {
  return axios.request({
    // url: "/warning/warningNotification/getIssueNoticeList",
    url: "/warning/warningNotification/getIssueNoticeList",
    method: "post",
    data: data
  });
};

// 队伍下拉
export const getTeam = (data) => {
  return axios.request({
    url: "/resource/baseResourceTeam/listTeamType",
    method: "get",
    data: data
  });
};

// 人员下拉
export const GetListTeamType = (data) => {
  return axios.request({
    url: "/resource/baseResourceTeam/listTeamType",
    method: "get",
    data: data
  });
};

// 装备下拉
export const GetEquipType = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/listEquipParam",
    method: "get",
    data: data
  });
};

// 车辆下拉
export const GetVehicleType = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/listVehicleProperties",
    method: "get",
    data: data
  });
};

// 预警任务-首页详情
export const homePageList = (data) => {
  return axios.request({
    url: "/warning/warningMainTask/homePageList",
    method: "get",
    data: data
  });
};

// 预警任务-子任务下派人员选择更改人员状态
export const updateStatus = (data) => {
  return axios.request({
    url: "/resource/baseResourceMember/updateMemberStatus",
    method: "get",
    data: data
  });
};

// 预警任务-子任务下派人员选择更改装备状态
export const updateEquip = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/updateStatus",
    method: "get",
    data: data
  });
};

// 预警任务-子任务下派人员选择更改车辆状态
export const updateVehicle = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/updateStatus",
    method: "get",
    data: data
  });
};

// 预警任务-首页
export const TaskStatistics = (data) => {
  return axios.request({
    url: "/warning/warningMainTask/professionalTaskStatistics",
    method: "get",
    data: data
  });
};

// 预警任务-首页柱状图
export const taskType = (data) => {
  return axios.request({
    url: "/warning/warningMainTask/taskStatistics",
    method: "get",
    data: data
  });
};

// 预警任务-根据分组获取字典列表
export const getDictList = (data) => {
  return axios.request({
    url: "/setting/dict/getDictList",
    method: "get",
    data: data
  });
};

